﻿using System;

/// <summary>
/// 单例模式基类 懒汉
/// </summary>
public class SingletonProvider<T> where T:new()
{
    public static T GetInstance()
    {
        return Nested.instance;
    }
    private class Nested
    {
        static Nested()
        {

        }
        internal static readonly T instance = (T)Activator.CreateInstance(typeof(T), true);
    }
}
